﻿/*
n!中的0 
Time Limit:1000MS  Memory Limit:32768K

  
Description:
贝贝很想搞清n!中到底有几个0，但是计算n!已经很不容易，很多很多位啊，算得头都晕了，
再开始数0的个数，怎么也数不清了，其实这件事情让计算机做，应该是比较容易做的，请你帮助贝贝解决这个难题吧。

Input:
输入数据中包含一些整数，每个整数不大于1000。 
Output:
输出每个整数的阶乘中0的个数，每个结果都回车。 
Sample Input:
3
8
9
10
Sample Output:
0
2
1
2
*/

#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main()
{
	vector<unsigned> v;
	unsigned maximum=0U;
	for (unsigned num; cin>>num; v.push_back(num))
		if(maximum<num)
			maximum=num;

	vector<unsigned> zeros;
	zeros.push_back(0U);
	zeros.push_back(0U);

	vector<unsigned> factorial;	
	factorial.push_back(1U);

	for (unsigned k=2U; k<=maximum; ++k)
	{
		unsigned carry=0U;
		for (unsigned i=0, length=factorial.size(); i<length; ++i)
		{
			unsigned product=factorial[i]*k+carry;
			factorial[i]=product%10;
			carry=product/10;
		}
		while (carry)
		{
			factorial.push_back(carry%10);
			carry/=10;
		}
// 		copy(factorial.rbegin(), factorial.rend(), ostream_iterator<unsigned>(cout, ""));
// 		cout<<endl;
		unsigned count0=count(factorial.begin(), factorial.end(), 0);
		zeros.push_back(count0);
	}
	
	for (vector<unsigned>::iterator it=v.begin(); it!=v.end(); ++it)
		cout<<zeros.at(*it)<<endl;
	
	return EXIT_SUCCESS;
}